home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / kupidon-strike.swf / scripts / frame_107 / PlaceObject2_241_618 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2011-12-21  |  1.9 KB  |  62 lines

  1. onClipEvent(enterFrame){
  2.    if(this.active)
  3.    {
  4.       if(move_delay >= 0)
  5.       {
  6.          move_delay--;
  7.       }
  8.       if(this.moveble && move_delay < 0)
  9.       {
  10.          if(c_path <= 0)
  11.          {
  12.             move_direction = -1;
  13.          }
  14.          if(c_path >= move_path)
  15.          {
  16.             move_direction = 1;
  17.          }
  18.          if(move_direction == 1)
  19.          {
  20.             c_path -= move_speed;
  21.             _X = _X + move_speed * Math.sin(move_angle * 0.017453292519943295);
  22.             _Y = _Y - move_speed * Math.cos(move_angle * 0.017453292519943295);
  23.          }
  24.          if(move_direction == -1)
  25.          {
  26.             c_path += move_speed;
  27.             _X = _X - move_speed * Math.sin(move_angle * 0.017453292519943295);
  28.             _Y = _Y + move_speed * Math.cos(move_angle * 0.017453292519943295);
  29.          }
  30.       }
  31.       if(this.hitTest(_root.bullet._x,_root.bullet._y,true) or this.hitTest(_root.bullet._x - 10 * Math.sin(_root.bullet._rotation * 0.017453292519943295),_root.bullet._y + 10 * Math.cos(_root.bullet._rotation * 0.017453292519943295),true) or this.hitTest(_root.bullet._x - 20 * Math.sin(_root.bullet._rotation * 0.017453292519943295),_root.bullet._y + 20 * Math.cos(_root.bullet._rotation * 0.017453292519943295),true))
  32.       {
  33.          _root.do_sound("sHeart-boom",false);
  34.          if(colour == "all")
  35.          {
  36.             rea();
  37.          }
  38.          else
  39.          {
  40.             res();
  41.          }
  42.       }
  43.       i = 0;
  44.       while(i < _root.tohit.length)
  45.       {
  46.          if(this.active && _root[_root.tohit[i]].active && this.hitTest(_root[_root.tohit[i]]._x,_root[_root.tohit[i]]._y,true))
  47.          {
  48.             _root.do_sound("sHeart-boom",false);
  49.             if(colour == "all")
  50.             {
  51.                rea();
  52.             }
  53.             else
  54.             {
  55.                res();
  56.             }
  57.          }
  58.          i++;
  59.       }
  60.    }
  61. }
  62.